<?php $this->_extends('../_layouts/default_layout'); ?>
<?php $this->_block('contents'); ?>
<script type="text/javascript">
$(function(){
	$(".datepicker").datepicker({dateFormat:'yy-mm-dd',changeMonth:true});
});
</script>
<fieldset><legend>查询条件</legend>
<form method="get">
<? include(Q::ini('custom_system/elements_dir') . 'searchform_element.php');?>
<table class="form_table">
<tr>
	<th>入库日期</th>
	<td>
		<input name="begin_storage_audit_time" value="<?=isset($_GET['begin_storage_audit_time']) ? $_GET['begin_storage_audit_time'] : ''?>" class="datepicker" /> to
		<input name="end_storage_audit_time" value="<?=isset($_GET['end_storage_audit_time']) ? $_GET['end_storage_audit_time'] : ''?>" class="datepicker" />
	</td>
</tr>
<tr>
	<th>采购单号</th>
	<td>
		<textarea rows="5" cols="20" name="number"><?=isset($_GET['number']) ? $_GET['number'] : ''?></textarea><br />
		说明：多个产品编号用回车分开
	</td>
	
</tr>
<tr>
	<td><input type="hidden" name="is_search" value="1" /></td>
	<td><input type="submit" class="button" value="查询" /></td>
</tr>
</table>
</form></fieldset>

<?if (isset($count)):?>
<h3>统计订单数：<?=$count?></h3>
<table class="list_table" width="50%">
<tr>
	<th></th>
	<th>制单至采购审核</th>
	<th>采购审核至采购完成</th>
	<th>采购完成至采购入库</th>
</tr>
<tr>
	<th>平均</th>
	<td title="<?=$result['avg']['time_1']?>秒"><?=Helper_BSS_Normal::time_difference($result['avg']['time_1'])?></td>
	<td title="<?=$result['avg']['time_2']?>秒"><?=Helper_BSS_Normal::time_difference($result['avg']['time_2'])?></td>
	<td title="<?=$result['avg']['time_3']?>秒"><?=Helper_BSS_Normal::time_difference($result['avg']['time_3'])?></td>
</tr>
<tr>
	<th>最大</th>
	<td title="<?=$result['max']['time_1']?>秒"><?=Helper_BSS_Normal::time_difference($result['max']['time_1'])?></td>
	<td title="<?=$result['max']['time_2']?>秒"><?=Helper_BSS_Normal::time_difference($result['max']['time_2'])?></td>
	<td title="<?=$result['max']['time_3']?>秒"><?=Helper_BSS_Normal::time_difference($result['max']['time_3'])?></td>
</tr>
<tr>
	<th>最小</th>
	<td title="<?=$result['min']['time_1']?>秒"><?=Helper_BSS_Normal::time_difference($result['min']['time_1'])?></td>
	<td title="<?=$result['min']['time_2']?>秒"><?=Helper_BSS_Normal::time_difference($result['min']['time_2'])?></td>
	<td title="<?=$result['min']['time_3']?>秒"><?=Helper_BSS_Normal::time_difference($result['min']['time_3'])?></td>
</tr>
</table>
<?endif;?>

<?php $this->_endblock();?>